import { createApp } from 'vue'

import ElementPlus from 'element-plus'
import pinia from '@/store/pinia'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import router from './router/index'
import App from './App.vue'
import BaiduMap from 'vue-baidu-map-3x'
import auth from'./directives/auth'

const app = createApp(App)
app.use(pinia)  //可以使用大的储物柜
app.use(router)
app.use(ElementPlus)
app.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'WRtFyWzCMm7h40nCjdhwyJsaCicKDZ1h',
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
});

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
  //console.log(key)
}
app.directive('auth', auth)
app.mount('#app')
